import request from '@/utils/request'

export interface UserInfoData{
    routes: string[],
    buttons: string[],
    roles: string[],
    name: string,
    avatar: string
}

interface TokenData{
    token:string
}

export interface LoginParamsData {
    username:string,
    password:string
}

export default{
    // GET /admin/acl/index/info
    // info
    
    // POST /admin/acl/index/login
    // login
    
    // POST /admin/acl/index/logout
    // logout
    
    userLogin(loginParams:LoginParamsData){
        return request.post<any,TokenData>('/admin/acl/index/login',loginParams)
    },
    
    getuserInfo() {
        return request.get<any,UserInfoData>('/admin/acl/index/info')
    },
    logout(){
        return request.post<any,null>('/admin/acl/index/logout')
    }

}